package com.zy.dp.command.example3;

public class Client
{
	public static void main(String[] args)
	{

		MainBoardApi mainBoard = new GigaMainBoard();
		OpenCommand openCommand = new OpenCommand(mainBoard);
		ResetCommand resetCommand = new ResetCommand(mainBoard);
		Box box = new Box();
		box.setOpenCommand(openCommand);
		box.setResetCommand(resetCommand);
		box.openButtonPressed();
		System.out.println("正确配置下------------------------->");
		System.out.println(">>>按下开机按钮：>>>");
		box.openButtonPressed();
		System.out.println(">>>按下重启按钮：>>>");
		box.resetButtonPressed();

		box.setOpenCommand(resetCommand);
		box.setResetCommand(openCommand);

		System.out.println("错误配置下------------------------->");
		System.out.println(">>>按下开机按钮：>>>");
		box.openButtonPressed();
		System.out.println(">>>按下重启按钮：>>>");
		box.resetButtonPressed();
	}
}
